package com.linzm.behavioraltype.observer07;

import com.linzm.behavioraltype.observer07.observer.BinaryObserver;
import com.linzm.behavioraltype.observer07.observer.HexaObserver;
import com.linzm.behavioraltype.observer07.observer.OctalObserver;

/**
 * @Author zimingl
 * @Date 2023/4/16 13:18
 * @Description: ObserverPatternDemo
 */
public class ObserverPatternDemo {
    public static void main(String[] args) {
        Subject subject = new Subject();

        new HexaObserver(subject);
        new OctalObserver(subject);
        new BinaryObserver(subject);

        System.out.println("First state change: 15");
        subject.setState(15);
        System.out.println("Second state change: 10");
        subject.setState(10);
    }
}
